<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name=renderer  content=webkit>
    <title>五四宪法历史资料陈列馆</title>
    <link rel="stylesheet" href="/static/css/style.css">
    <link rel="stylesheet" href="/static/layui/layui/css/layui.css"  media="all">
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/common.js"></script>
    <script src="/static/layui/layui/layui.all.js"></script>
</head>
<style>
    .arrive-time{
        font-size: 0.8em;
        color: #999;
        padding: 5px;
    }
</style>
<body>
<form name="order_info" id="order_info" action="orderInfo" method="post">
    <div class="main order_info1">
        <div class="top">
            <a class="back" href="javascript:history.back(-1)"><img src="/static/image/left.png" alt="">返回</a>
            预约信息
            <a class="back sybb right">上一步</a>
        </div>
<!--        <input type="hidden" name="venue" value="{$Think.get.venue}">-->
        <div class="order_info container">
            <div class="syb">
                <div class="s-title">参观类型：</div>
                <div class="select">
                    <a href="javascript:;" class="venue on geren w30"  data-v="A" ><img src="/static/pc/img/button.png" alt="">个人</a>
                    <a href="javascript:;" class="venue tuanti w30" data-v="B"><img src="/static/pc/img/button1.png" alt="">团体</a>
                </div>

                <div class="select">
                    <div class="s-title gerenx">政治面貌：</div>
                    <img src="/static/image/down_solid.png" alt="">
                    <select name="department" class="gerenx" id="gerenx">
                        <option value = "">请选择政治面貌</option>
                        <option value = "党员">党员</option>
                        <option value = "团员">团员</option>
                        <option value = "群众">群众</option>
                        <option value = "民主党派人士">民主党派人士</option>
                    </select>
                </div>

                <div class="s-title tuand"  style="display: none;">单位性质：</div>
                <div class="select tuand" style="display: none;">
                    <img src="/static/image/down_solid.png" alt="">
                    <select name="position_type" id="position_type">
                        <option value = "">请选择单位性质</option>
                        {foreach $position_type as $k=>$v}
                        <option value="{$v}">{$v}</option>
                        {/foreach}
                    </select>
                </div>

                <div class="s-title">国籍：</div>
                <input type="text" autofocus="autofocus" name="nationality" title="单位名称"  onkeyup="isChina(this)"   value="中国" >
                <div class="quxian">
                <div class="select" >
                    <div class="s-title " >省：</div>
                    <img src="/static/image/down_solid.png" alt="">
                    <select name="province" class="province">
                        {foreach $province as $k=>$v}
                            {if $k eq 933}
                                <option value="{$k}" selected>{$v}</option>
                                {else/}
                             <option value="{$k}">{$v}</option>
                            {/if}
                        {/foreach}
                    </select>
                </div>

                <div class="select city1" >
                    <div class="s-title " >市：</div>
                    <img src="/static/image/down_solid.png" alt="">
                    <select name="city_id" class="city">
                        {foreach $city as $k=>$v}
                            {if $k eq 934}
                                <option value="{$k}" selected>{$v}</option>
                                {else/}
                                <option value="{$k}">{$v}</option>
                            {/if}
                        {/foreach}
                    </select>
                </div>


                <div class="select country1" style="display:none">
                    <div class="s-title " >区/县：</div>
                    <img src="/static/image/down_solid.png" alt="">
                    <select name="country_id"  class="country">

                    </select>
                </div>

                </div>

                <div class="s-title tuand " style="display: none;">单位名称：</div>
                <input type="text" autofocus="autofocus" name="company" title="单位名称" class="tuand"   style="display: none;" >


                <div class="s-title">预约联系人姓名：</div>
                <input type="text" name="name" title="预约联系人姓名" class="contact_name">


                <div class="s-title">手机号：</div>
                <input type="text" name="mobile" title="手机号" class="mobile">



<!--                <div class="s-title">预约备注：</div>-->
<!--                <input type="text" name="note" placeholder="选填">-->
                <div class="s-title">输入验证码：</div>
                <input type="text" name="code" class="code1" title="短信验证码">
                <a href="javascript:;" class="send" onclick="getVerifyCode(this)">发送验证码</a>
                <a href="javascript:;" class="submit xybb" >下一步</a>
            </div>

            <div class="xyb" style="display:none;">
                <div class="s-title tuan1">参观场馆：</div>
                <div class="select select_venue">
                    <a href="javascript:;" class="venue first on"  data-v="A" ><img src="/static/pc/img/button.png" alt="">北山街馆区</a>
                    <a href="javascript:;" class="venue second" data-v="B"><img src="/static/pc/img/button1.png" alt="">栖霞岭馆区</a>
                    <a href="javascript:;" class="venue last" data-v="C"><img src="/static/pc/img/button1.png" alt="">北山街和栖霞岭馆区</a>
                </div>

                <div class="s-title tuand" style="display: none;">参观人数：</div>
                <input type="text" name="views" title="参观人数" class="tuand cgr check" style="display: none;" >


                <div class="tuand" style="display: none">
                    <div class="choose_date">
                        <div class="s-title explain"  style="display: none" > 是否需要讲解：</div>
                        <img src="/static/image/down_solid.png" alt="" class="down">
                        <select name="explain" class="explain explain1"  style="display: none">
                            <option value="1" >需要</option>
                            <option value="0" selected>不需要</option>
                        </select>
                    </div>
                </div>

                <input class="guan1"  name="venue" type="hidden" value="A">


                <div class="cg_time">
                    <div class="s-title">参观日期：</div>
                    <div class="choose_date">
                        <input type="text" name="day"  id="dateBox" class="cday timeday"  value="{$time[0]}" >
    <!--                    <input type="date" name="day" class="timeday choosetime1" min="{$time[0]}" value="{$time[0]}" max="">-->
<!--                        <select name="day" id="" class="timeday">-->
<!--                            {foreach $time as $k=>$v}-->
<!--                            <option value="{$v}">{$v}</option>-->
<!--                            {/foreach}-->
<!--                        </select>-->
                    </div>
                    <div class="choose_time">
                        <div class="s-title view-info">可参观时间段：</div>
                        <!-- A馆-->
                        <div class="aguan">
                            <div class="guan">北山街馆区</div>
                            {foreach $visit_time as $k=>$v}
                            <p href="javascript:;"  {if condition="in_array($k,$yuyue)"} class="booked" {/if} onclick="setValue({$k})"> {$v}</p>
                            {/foreach}
                            <div class="arrive-time">预计到达时间</div>
                        </div>
                        <div class="clear"></div>

                        <div class="timePart select">
                            <a href="javascript:;" class="venue morninga on">上午</a>
                            <a href="javascript:;" class="venue afternoona">下午</a>
                        </div>
                        <div class="arriveTime select">
                            <select name="" id="visithour_a">
                                <option value="9">9</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                            </select>
                            <span>时</span>
                            <select name="" id="visitminute_a">
                                <option value="00">0</option>
                                <option value="15">15</option>
                                <option value="30">30</option>
                                <option value="45">45</option>
                            </select>
                            <span>分</span>
                            <br>
                            <select name="" id="visithour_p">
                                <option value="14">14</option>
                                <option value="15">15</option>
                                <option value="16">16</option>
                            </select>
                            <span>时</span>
                            <select name="" id="visitminute_p">
                                <option value="00">0</option>
                                <option value="15">15</option>
                                <option value="30">30</option>
                                <option value="45">45</option>
                            </select>
                            <span>分</span>
                            <input type="hidden" name="arrivea_part" class="arrivea_part">
                            <input type="hidden" name="arrivea" class="arrivea">
                        </div>

                        <div class="clear"></div>
                        <!-- B馆-->
                        <div class="bguan">
                            <input type="text"  id="dateBox1" name="day1" class="bday timeday1 guan" value="{$time[0]}" style="display: none">
                            <div class="guan">栖霞岭馆区</div>
                            {foreach $visit_time as $k=>$v}
                            <p onclick="setValue({$k})">{$v}</p>
                            {/foreach}
                            <div class="arrive-time">预计到达时间</div>
                        </div>

                        <div class="timePartb select">
                            <a href="javascript:;" class="venue morningb on">上午</a>
                            <a href="javascript:;" class="venue afternoonb">下午</a>
                        </div>
                        <div class="arriveTimeb select">
                            <div>
                                <select name="" id="Bvisithour_a">
                                    <option value="9">9</option>
                                    <option value="10">10</option>
                                    <option value="11">11</option>
                                </select>
                                <span>时</span>
                                <select name="" id="Bvisitminute_a">
                                    <option value="00">0</option>
                                    <option value="15">15</option>
                                    <option value="30">30</option>
                                    <option value="45">45</option>
                                </select>
                                <span>分</span>
                            </div>
                            <select name="" id="Bvisithour_p">
                                <option value="14">14</option>
                                <option value="15">15</option>
                                <option value="16">16</option>
                            </select>
                            <span>时</span>
                            <select name="" id="Bvisitminute_p">
                                <option value="00">0</option>
                                <option value="15">15</option>
                                <option value="30">30</option>
                                <option value="45">45</option>
                            </select>
                            <span>分</span>
                            <input type="hidden" name="arriveb_part" class="arriveb_part">
                            <input type="hidden" name="arriveb" class="arriveb">
                        </div>
                        <div class="clear"></div>
                        <em class="tuand" style="display: none;">*北山街馆区内提供自动语音讲解服务，馆内扫码讲解。</em>
                    </div>
                    <input type="hidden" id="between_time" class="check" name="time" title="时间">
                </div>



    <!--            <div class="speak" style="display: none;">-->
    <!--            <div class="s-title">调解员列表：</div>-->
    <!--                <div class="choose_date">-->
    <!--                    <select name="admin_id"  class="tiaojie">-->
    <!--                        <option value="" selected>&#45;&#45;请选择&#45;&#45;</option>-->
    <!--                    </select>-->
    <!--                </div>-->
    <!--            </div>-->



                    <input type="hidden" value="0" name="type" class="type1">
                    <input type="hidden" name="status" value="1">
                    <a href="javascript:;" class="submit" onclick="checkParse()" >完成</a>
                </div>
         </div>


    </div>

</form>
<script>
    changeArriveTimeInfo()
    function isChina(obj){
        if($(obj).val()!="中国"){
            $(obj).siblings('span').html("国籍及地址");
            $('.quxian').hide();

        }else{
            $(obj).siblings('span').html("国籍");
            $('.quxian').show()
        }
    }
    $(".explain1").change(function(){
        if($(this).val() == 1){
            changeArriveTimeInfo(1)
            $('.aguan').hide();
            // $('.guan').hide();
            $('.bguan>p').hide();
            if($('.first').hasClass('on')){
                $('.timePart').show()
                $('.arriveTime').show()
                $('.timePartb').hide()
                $('.arriveTimeb').hide()
                $('.aguan').show();
                $('.aguan guan').show();
                $('.bguan').hide();
                $('.bguan guan').hide();
            }
            if($('.second').hasClass('on')){
                $('.timePart').hide()
                $('.arriveTime').hide()
                $('.timePartb').show()
                $('.arriveTimeb').show()
                $('.aguan').hide();
                $('.aguan guan').hide();
                $('.bguan').show();
                $('.bguan guan').show();
            }
            if($('.last').hasClass('on')){
                $('.timePart').show()
                $('.arriveTime').show()
                $('.timePartb').show()
                $('.arriveTimeb').show()
                $('.aguan').show();
                $('.aguan guan').show();
                $('.bguan').show();
                $('.bguan guan').show();
            }
        }else{
            changeArriveTimeInfo()
            $('.aguan').show();
            $('.guan').show();
            $('.timePart').hide()
            $('.arriveTime').hide()
            $('.timePartb').hide()
            $('.arriveTimeb').hide()
            $('.bguan').removeClass('hide');
        }
        var venue =  $(".select_venue .on").attr("data-v");
        var day = $(".cday").val();
        var day1 = $(".bday").val();
        $.ajax({
            type: 'POST',
            url: 'runimformation',
            data: {"day":day,"venue":venue,"day1":day1,'explain':$(".explain1").val()},
            dataType:'json',
            success: function (result) {
                $(".aguan").find("p").remove();
                $(".bguan").find("p").remove();
                // var arr=JSON.stringify(result.yuyuea);
                // console.log(arr);
                // if (result.yuyue){
                    if(result.explain == 1){
                        if(result.yuyueb){
                            if(result.yuyueb == ""){
                                // return ;
                            }
                            if(result.yuyueb == "0"){
                                // alert(result.venue1+"上午的预约人数已满");
                                layer.alert(result.venue1+"上午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                // return ;
                            }
                            if(result.yuyueb == "1"){
                                // alert(result.venue1+"下午的预约人数已满");
                                layer.alert(result.venue1+"下午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                // return ;
                            }
                            if(result.yuyueb == "0,1"){
                                // alert(result.venue1+"当日预约人数已满");
                                layer.alert(result.venue1+"当日预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                // return ;
                            }
                        }
                        if(result.yuyue == ""){
                            return ;
                        }
                        if(result.yuyue == "0"){
                            // alert(result.venue+"上午的预约人数已满");
                            layer.alert(result.venue+"上午的预约人数已满",{
                                icon: 2,
                                title:false,
                                time:5000
                            })
                            return ;
                        }
                        if(result.yuyue == "1"){
                            // alert(result.venue+"下午的预约人数已满");
                            layer.alert(result.venue+"下午的预约人数已满",{
                                icon: 2,
                                title:false,
                                time:5000
                            })
                            return ;
                        }
                        if(result.yuyue == "0,1"){
                            // alert(result.venue+"当日预约人数已满");
                            layer.alert(result.venue+"当日预约人数已满",{
                                icon: 2,
                                title:false,
                                time:5000
                            })
                            return ;
                        }
                    }else{
                        var arr=JSON.stringify(result.yuyue);
                        var cc=JSON.parse(arr);
                        $.each(result.visit,function(i,val){
                            if($.inArray(i, cc )==-1){
                                $(".aguan").append(
                                    '<p href="javascript:;" onclick="setValue()" >' +
                                    val+ "</p>")
                            }else{
                                $(".aguan").append(
                                    '<p href="javascript:;" class="booked" onclick="setValue()" >' +
                                    val+ "</p>")
                            }
                        });
                        if(result.yuyueb){
                            $(".bguan").css("display","block");
                            $(".bguan").append(
                                ' <input class="time1" name="time1" type="hidden">');
                            var arr1=JSON.stringify(result.yuyueb);
                            var cc1=JSON.parse(arr1);
                            $.each(result.visit,function(i,val){
                                if($.inArray( i, cc1 )==-1){
                                    $(".bguan").append(
                                        '<p href="javascript:;" onclick="setValue1()" >' +
                                        val+ "</p>")
                                }else{
                                    $(".bguan").append(
                                        '<p href="javascript:;" class="booked"  onclick="setValue1()" >' +
                                        val+ "</p>")
                                }
                            })
                        }
                    }
                // }
            },
            error: function(result){
                // alert("错误");
                layer.alert('错误',{
                    icon: 2,
                    title:false,
                    time:5000
                })
            },
        });
    })
    var flagXyb = false;
    $(".xybb").click(function(){
        var tuand = $('input.tuand').val()
        var contactName = $('input.contact_name').val()
        var mobile = $('input.mobile').val()
        var code1 = $('input.code1').val()
        var position_type = $('#position_type option:selected') .val();
        var gerenx= $('#gerenx option:selected') .val();

        if($(".type1").val()==1){
            if(position_type==''){
                // alert('请选择单位性质')
                layer.alert('请选择单位性质',{
                    icon: 2,
                    title:false,
                    time:5000
                })
                return
            }
        }else{
            if(gerenx==''){
                // alert('请选择政治面貌alalertert')
                layer.alert('请选择政治面貌',{
                    icon: 2,
                    title:false,
                    time:5000

                })
                return
            }
        }


        if(tuand == ""){
            if($('.tuanti').hasClass('on')){
                // alert('请输入单位名称')
                layer.alert('请输入单位名称',{
                    icon: 2,
                    title:false,
                    time:5000
                })
                return
            }else{

            }
        }
        if(contactName == ""){
            // alert('请输入联系人姓名')
            layer.alert('请输入联系人姓名',{
                icon: 2,
                title:false,
                time:5000
            })
            return
        }
        if(mobile == ""){
            // alert('请输入联系人手机号')
            layer.alert('请输入联系人手机号',{
                icon: 2,
                title:false,
                time:5000
            })
            return
        }
        if(!mobile == ""){
            var tel = $('.order_info .mobile').val();
            var reg = /(^1[3|4|5|7|8][0-9]{9}$)/;
            //手机号格式正确
            if (!reg.test(tel)) {
                // alert('请输入正确的手机号');
                layer.alert('请输入正确的手机号',{
                    icon: 2,
                    title:false,
                    time:5000
                })
                return false;
            }
        }
        if(code1== ""){
            // alert('请输入验证码')
            layer.alert('请输入验证码',{
                icon: 2,
                title:false,
                time:5000
            })
            return
        }else{
            $(".syb").css("display","none");
            $(".xyb").css("display","block");
            $(".sybb").css("display","block");
        }
    })
    $(".sybb").click(function(){
        $(".syb").css("display","block");
        $(".xyb").css("display","none");
        $(".sybb").css("display","none");
    })

    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#dateBox', //指定元素
            min:0,
            ready: function() {
                $(".layui-laydate-content table tr td:nth-child(2)").addClass('laydate-disabled')
                $.ajax({
                    type: 'GET',
                    url: '/getDate',
                    success: function (result) {
                        var conNotV = result.conNotView;
                        var conV = result.canVIew;
                        var dataEm = $(".layui-laydate-content table tr td");
                        $.each(dataEm,function(key,item){
                            if(!($.inArray(item.getAttribute('lay-ymd'), conV) == -1)){
                                item.setAttribute('class','');
                            }
                            if(!($.inArray(item.getAttribute('lay-ymd'), conNotV) == -1)){
                                item.setAttribute('class','laydate-disabled');
                            }
                        })
                    },
                    error: function(result){
                    },
                });
                if($(".explain1").val() ==1 ){
                    $(".layui-laydate-content table tr td:nth-child(7)").addClass('laydate-disabled')
                    $(".layui-laydate-content table tr td:nth-child(1)").addClass('laydate-disabled')
                }
            },
            change: function() {
                $(".layui-laydate-content table tr td:nth-child(2)").addClass('laydate-disabled')
                if($(".explain1").val() ==1 ){
                    $(".layui-laydate-content table tr td:nth-child(7)").addClass('laydate-disabled')
                    $(".layui-laydate-content table tr td:nth-child(1)").addClass('laydate-disabled')
                }
            },
            done: function(value, date, endDate){
                $(".cday").val(value);
                var venue =  $(".select_venue .on").attr("data-v");
                var day = $(".cday").val();
                var day1 = $(".bday").val();
                $.ajax({
                    type: 'POST',
                    url: 'runimformation',
                    data: {"day":day,"venue":venue,"day1":day1,'explain':$(".explain1").val()},
                    dataType:'json',
                    success: function (result) {
                        $(".aguan").find("p").remove();
                        // $(".bguan").find("p").remove();
                        // if (result.yuyue){
                            if(result.explain == 1){
                                if(result.yuyueb){
                                    if(result.yuyueb == ""){
                                        // return ;
                                    }
                                    if(result.yuyueb == "0"){
                                        // alert(result.venue1+"上午的预约人数已满");
                                        layer.alert(result.venue1+"上午的预约人数已满",{
                                            icon: 2,
                                            title:false,
                                            time:5000
                                        })
                                        // return ;
                                    }
                                    if(result.yuyueb == "1"){
                                        // alert(result.venue1+"下午的预约人数已满");
                                        layer.alert(result.venue1+"下午的预约人数已满",{
                                            icon: 2,
                                            title:false,
                                            time:5000
                                        })
                                        // return ;
                                    }
                                    if(result.yuyueb == "0,1"){
                                        // alert(result.venue1+"当日预约人数已满");
                                        layer.alert(result.venue1+"当日预约人数已满",{
                                            icon: 2,
                                            title:false,
                                            time:5000
                                        })
                                        // return ;
                                    }
                                }
                                if(result.yuyue == ""){
                                    return ;
                                }
                                if(result.yuyue == "0"){
                                    // alert(result.venue+"上午的预约人数已满");
                                    layer.alert(result.venue+"上午的预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    return ;
                                }
                                if(result.yuyue == "1"){
                                    // alert(result.venue+"下午的预约人数已满");
                                    layer.alert(result.venue+"下午的预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    return ;
                                }
                                if(result.yuyue == "0,1"){
                                    //alert(result.venue+"当日预约人数已满");
                                    layer.alert(result.venue+"当日预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    return ;
                                }
                            }else{
                                var arr=JSON.stringify(result.yuyue);
                                var cc=JSON.parse(arr);
                                $.each(result.visit,function(i,val){
                                    if($.inArray( i, cc )==-1){
                                        $(".aguan").append(
                                            '<p href="javascript:;" onclick="setValue()" >' +
                                            val+ "</p>")
                                    }else{
                                        $(".aguan").append(
                                            '<p href="javascript:;" class="booked" onclick="setValue()" >' +
                                            val+ "</p>")
                                    }
                                });
                            }

                        // }
                        // if( $(".explain1").val() == 0  && $(".type1").val() ==1 && $(".cgr").val() < 10  ){
                        //     $(".aguan").find("p").each(function(){
                        //         $(this).addClass("booked");
                        //     })
                        //     $(".bguan").find("p").each(function(){
                        //         $(this).addClass("booked");
                        //     })
                        // }
                    },
                    error: function(result){
                        // alert("21321");
                    },
                });

            },
            max : 60
        });
    });
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#dateBox1', //指定元素
            min:0,
            ready: function() {
                $(".layui-laydate-content table tr td:nth-child(2)").addClass('laydate-disabled')
                $.ajax({
                    type: 'GET',
                    url: '/getDate',
                    success: function (result) {
                        var conNotV = result.conNotView;
                        var conV = result.canVIew;
                        var dataEm = $(".layui-laydate-content table tr td");
                        $.each(dataEm,function(key,item){
                            if(!($.inArray(item.getAttribute('lay-ymd'), conV) == -1)){
                                item.setAttribute('class','');
                            }
                            if(!($.inArray(item.getAttribute('lay-ymd'), conNotV) == -1)){
                                item.setAttribute('class','laydate-disabled');
                            }
                        })
                    },
                    error: function(result){
                    },
                });
                if($(".explain1").val() ==1 ){
                    $(".layui-laydate-content table tr td:nth-child(1)").addClass('laydate-disabled')
                    $(".layui-laydate-content table tr td:nth-child(7)").addClass('laydate-disabled')
                }
            },
            change: function() {
                $(".layui-laydate-content table tr td:nth-child(2)").addClass('laydate-disabled')
                if($(".explain1").val() ==1 ){
                    $(".layui-laydate-content table tr td:nth-child(7)").addClass('laydate-disabled')
                    $(".layui-laydate-content table tr td:nth-child(1)").addClass('laydate-disabled')
                }
            },
            done: function(value, date, endDate){
                $(".bday").val(value);
                var venue =  $(".select_venue .on").attr("data-v");
                var day = $(".cday").val();
                // alert($(".bday").val());
                var day1 = $(".bday").val();
                $.ajax({
                    type: 'POST',
                    url: 'runimformation',
                    data: {"day":day,"venue":venue,"day1":day1,'explain':$(".explain1").val()},
                    dataType:'json',
                    success: function (result) {
                        $(".bguan").find("p").remove();
                        // if (result.yuyue){
                            if(result.explain == 1){
                                if(result.yuyueb){
                                    if(result.yuyueb == ""){
                                        // return ;
                                    }
                                    if(result.yuyueb == "0"){
                                        // alert(result.venue1+"上午的预约人数已满");
                                        layer.alert(result.venue1+"上午的预约人数已满",{
                                            icon: 2,
                                            title:false,
                                            time:5000
                                        })
                                        // return ;
                                    }
                                    if(result.yuyueb == "1"){
                                        // alert(result.venue1+"下午的预约人数已满");
                                        layer.alert(result.venue1+"下午的预约人数已满",{
                                            icon: 2,
                                            title:false,
                                            time:5000
                                        })
                                        // return ;
                                    }
                                    if(result.yuyueb == "0,1"){
                                        // alert(result.venue1+"当日预约人数已满");
                                        layer.alert(result.venue1+"当日预约人数已满",{
                                            icon: 2,
                                            title:false,
                                            time:5000
                                        })
                                        // return ;
                                    }
                                }
                                if(result.yuyue == ""){
                                    return ;
                                }
                                if(result.yuyue == "0"){
                                    // alert(result.venue+"上午的预约人数已满");
                                    layer.alert(result.venue+"上午的预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    return ;
                                }
                                if(result.yuyue == "1"){
                                    // alert(result.venue+"下午的预约人数已满");
                                    layer.alert(result.venue+"下午的预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    return ;
                                }
                                if(result.yuyue == "0,1"){
                                    // alert(result.venue+"当日预约人数已满");
                                    layer.alert(result.venue+"当日预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    return ;
                                }
                            }else{
                                if(result.yuyueb){
                                    $(".bguan").css("display","block");
                                    $(".bguan").append(
                                        ' <input class="time1" name="time1" type="hidden">');
                                    var arr1=JSON.stringify(result.yuyueb);
                                    var cc1=JSON.parse(arr1);
                                    $.each(result.visit,function(i,val){
                                        if($.inArray( i, cc1 )==-1){
                                            $(".bguan").append(
                                                '<p href="javascript:;" onclick="setValue1()" >' +
                                                val+ "</p>")
                                        }else{
                                            $(".bguan").append(
                                                '<p href="javascript:;" class="booked"  onclick="setValue1()" >' +
                                                val+ "</p>")
                                        }
                                    })
                                }
                            }
                        // }
                        // if( $(".explain1").val() == 0  && $(".type1").val() ==1 && $(".cgr").val() < 10  ){
                        //     $(".aguan").find("p").each(function(){
                        //         $(this).addClass("booked");
                        //     })
                        //     $(".bguan").find("p").each(function(){
                        //         $(this).addClass("booked");
                        //     })
                        // }
                    },
                    error: function(result){
                    },
                });

            },
            max : 60
        });
    });
    //发送验证码
    var countdown = 60;
    function settime(obj) {
        if (countdown == 0) {
            obj.attr("onclick","getVerifyCode()")//设置onclick属性
            obj.text("获取短信验证码");
            countdown = 60;
            return;
        } else {
            obj.removeAttr("onclick");//移除onclick属性
            obj.text("重新发送(" + countdown + ")");
            countdown--;
        }
        setTimeout(function() {settime(obj) },1000);//设置定时任务，1000毫秒为1秒
    }
    function getVerifyCode(obj) {
        var mobile = $(".mobile").val();
        if(mobile == ""){
            // alert("请输入手机号");
            layer.alert('请输入手机号',{
                icon: 2,
                title:false,
                time:5000
            })
            return false;
        }
        else{
            $.ajax({
                type: 'get',
                url: '/yuyue_code',
                data: {"mobile":$(".mobile").val()},
                dataType:'json',
                success: function (result) {
                    // $(".code1").val(result.code);
                    settime($(".send"));//设置倒计时
                     layer.msg("发送成功");

                    return false;
                },
                error: function(result){
                    // alert("21321");
                },
            });
        }
    }
    $(".geren").click(function(){
        $(".type1").val(0);
        $(".gerenx").css("display","block");
        $(".speak").css("display","none");
        $(".tuand").css("display","none");
    })
    $(".tuanti").click(function(){
        $(".gerenx").val("");
        $(".gerenx").css("display","none");
        $(".tuand").css("display","block");
        $(".type1").val(1);
        if( $(".cgr").val() < 10){
            $(".aguan").find("p").addClass("booked");
        }
    })
    function changeArriveTimeInfo(o=false){
        if(o){
            $('.arrive-time').text('预计到达时间')
            $('.view-info').text('')
        }else{
            $('.arrive-time').text('')
            $('.view-info').text('可参观时段')
        }

    }
    $(".cgr").blur(function () {

        // alert($(".cgr").val());
        if($(".cgr").val() >=10){
            $(".explain").css("display","block");
            // $(".explain1").css("display","block")
            $(".explain1").val(0);
            $(".timePart").css("display","none");
            $(".timePartb").css("display","none");
            $(".arriveTime").css("display","none");
            $(".arriveTimeb").css("display","none");
            var venue =  $(".select_venue .on").attr("data-v");
            var day = $(".cday").val();
            var day1 = $(".bday").val();
            $.ajax({
                type: 'POST',
                url: 'runimformation',
                data: {"day":day,"venue":venue,"day1":day1,'explain':$(".explain1").val()},
                dataType:'json',
                success: function (result) {
                    $(".aguan").find("p").remove();
                    $(".bguan").find("p").remove();
                    // var arr=JSON.stringify(result.yuyuea);
                    // console.log(arr);
                    // if (result.yuyue){
                        if(result.explain == 1){
                            if(result.yuyueb){
                                if(result.yuyueb == ""){
                                    // return ;
                                }
                                if(result.yuyueb == "0"){
                                    // alert(result.venue1+"上午的预约人数已满");
                                    layer.alert(result.venue1+"上午的预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    // return ;
                                }
                                if(result.yuyueb == "1"){
                                    // alert(result.venue1+"下午的预约人数已满");
                                    layer.alert(result.venue1+"下午的预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    // return ;
                                }
                                if(result.yuyueb == "0,1"){
                                    // alert(result.venue1+"当日预约人数已满");
                                    layer.alert(result.venue1+"当日预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    // return ;
                                }
                            }
                            if(result.yuyue == ""){
                                return ;
                            }
                            if(result.yuyue == "0"){
                                // alert(result.venue+"上午的预约人数已满");
                                layer.alert(result.venue+"上午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }
                            if(result.yuyue == "1"){
                                // alert(result.venue+"下午的预约人数已满");
                                layer.alert(result.venue+"下午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }
                            if(result.yuyue == "0,1"){
                                // alert(result.venue+"当日预约人数已满");
                                layer.alert(result.venue+"当日预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }
                        }else{
                            var arr=JSON.stringify(result.yuyue);
                            var cc=JSON.parse(arr);
                            $.each(result.visit,function(i,val){
                                if($.inArray(i, cc )==-1){
                                    $(".aguan").append(
                                        '<p href="javascript:;" onclick="setValue()" >' +
                                        val+ "</p>")
                                }else{
                                    $(".aguan").append(
                                        '<p href="javascript:;" class="booked" onclick="setValue()" >' +
                                        val+ "</p>")
                                }
                            });
                            if(result.yuyueb){
                                $(".bguan").css("display","block");
                                $(".bguan").append(
                                    ' <input class="time1" name="time1" type="hidden">');
                                var arr1=JSON.stringify(result.yuyueb);
                                var cc1=JSON.parse(arr1);
                                $.each(result.visit,function(i,val){
                                    if($.inArray( i, cc1 )==-1){
                                        $(".bguan").append(
                                            '<p href="javascript:;" onclick="setValue1()" >' +
                                            val+ "</p>")
                                    }else{
                                        $(".bguan").append(
                                            '<p href="javascript:;" class="booked"  onclick="setValue1()" >' +
                                            val+ "</p>")
                                    }
                                })
                            }
                        }
                    // }
                    // if( $(".explain1").val() == 0  && $(".type1").val() ==1 && $(".cgr").val() < 10  ){
                    //     $(".aguan").find("p").each(function(){
                    //         $(this).addClass("booked");
                    //     })
                    //     $(".bguan").find("p").each(function(){
                    //         $(this).addClass("booked");
                    //     })
                    // }
                },
                error: function(result){
                    // alert("错误");
                    layer.alert("错误",{
                        icon: 2,
                        title:false,
                        time:5000
                    })
                },
            });
        }else{
            $(".explain").css("display","none");
            $(".explain1").val(0);
            $(".timePart").css("display","none");
            $(".timePartb").css("display","none");
            $(".arriveTime").css("display","none");
            $(".arriveTimeb").css("display","none");
            var venue =  $(".select_venue .on").attr("data-v");
            var day = $(".cday").val();
            var day1 = $(".bday").val();
            $.ajax({
                type: 'POST',
                url: 'runimformation',
                data: {"day":day,"venue":venue,"day1":day1,'explain':$(".explain1").val()},
                dataType:'json',
                success: function (result) {
                    $(".aguan").find("p").remove();
                    $(".bguan").find("p").remove();
                    // var arr=JSON.stringify(result.yuyuea);
                    // console.log(arr);
                    // if (result.yuyue){
                        if(result.explain == 1){
                            if(result.yuyueb){
                                if(result.yuyueb == ""){
                                    // return ;
                                }
                                if(result.yuyueb == "0"){
                                    // alert(result.venue1+"上午的预约人数已满");
                                    layer.alert(result.venue1+"上午的预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    // return ;
                                }
                                if(result.yuyueb == "1"){
                                    // alert(result.venue1+"下午的预约人数已满");
                                    layer.alert(result.venue1+"下午的预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    // return ;
                                }
                                if(result.yuyueb == "0,1"){
                                    // alert(result.venue1+"当日预约人数已满");
                                    layer.alert(result.venue1+"当日预约人数已满",{
                                        icon: 2,
                                        title:false,
                                        time:5000
                                    })
                                    // return ;
                                }
                            }
                            if(result.yuyue == ""){
                                return ;
                            }
                            if(result.yuyue == "0"){
                                // alert(result.venue+"上午的预约人数已满");
                                layer.alert(result.venue+"上午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }
                            if(result.yuyue == "1"){
                                // alert(result.venue+"下午的预约人数已满");
                                layer.alert(result.venue+"下午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }
                            if(result.yuyue == "0,1"){
                                // alert(result.venue+"当日预约人数已满");
                                layer.alert(result.venue+"当日预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }
                        }else{
                            var arr=JSON.stringify(result.yuyue);
                            var cc=JSON.parse(arr);
                            $.each(result.visit,function(i,val){
                                if($.inArray(i, cc )==-1){
                                    $(".aguan").append(
                                        '<p href="javascript:;" onclick="setValue()" >' +
                                        val+ "</p>")
                                }else{
                                    $(".aguan").append(
                                        '<p href="javascript:;" class="booked" onclick="setValue()" >' +
                                        val+ "</p>")
                                }
                            });
                            if(result.yuyueb){
                                $(".bguan").css("display","block");
                                $(".bguan").append(
                                    ' <input class="time1" name="time1" type="hidden">');
                                var arr1=JSON.stringify(result.yuyueb);
                                var cc1=JSON.parse(arr1);
                                $.each(result.visit,function(i,val){
                                    if($.inArray( i, cc1 )==-1){
                                        $(".bguan").append(
                                            '<p href="javascript:;" onclick="setValue1()" >' +
                                            val+ "</p>")
                                    }else{
                                        $(".bguan").append(
                                            '<p href="javascript:;" class="booked"  onclick="setValue1()" >' +
                                            val+ "</p>")
                                    }
                                })
                            }
                        // }
                    }
                    // if( $(".explain1").val() == 0  && $(".type1").val() ==1 && $(".cgr").val() < 10  ){
                    //     $(".aguan").find("p").each(function(){
                    //         $(this).addClass("booked");
                    //     })
                    //     $(".bguan").find("p").each(function(){
                    //         $(this).addClass("booked");
                    //     })
                    // }
                },
                error: function(result){
                    layer.alert('错误',{
                        icon: 2,
                        title:false,
                        time:5000
                    })
                },
            });
        }
        if($(".cgr").val() >100){
            // alert("预约人数不能大于100");
            layer.alert('单场预约人数不能大于100',{
                icon: 2,
                title:false,
                time:5000
            })
        }
    })



    function setValue() {
        $('.choose_time .aguan').on("click","p",function(){
            if($(this).hasClass('booked') || $(this).hasClass('booked1')){
                return false;
            }
            var time =  $(this).text();
            $(this).addClass('select').siblings().removeClass('select');
            $("#between_time").val(time);
        })
        }
    function setValue1() {
        $('.choose_time .bguan').on("click","p",function(){
            if($(this).hasClass('booked') || $(this).hasClass('booked1')){
                return false;
            }
            var time =  $(this).text();
            $(this).addClass('select').siblings().removeClass('select');
            $(".time1").val(time);
        })
    }

    $('.venue').click(function(){
        $(this).addClass('on').siblings('.venue').removeClass('on');
        $(this).find('img').attr('src','/static/pc/img/button.png');
        $(this).siblings('.venue').find('img').attr('src','/static/pc/img/button1.png');
    })
    $('.select_venue a').click(function(){
        var checkValue = $(this).attr("data-v");
        $('input.guan').val(checkValue);
        if(checkValue =='C'){
            $(".bguan").show();
            $('.guan').show();
        }else{
            $(".bguan").hide()
            $('.guan').hide();
        }
        if($('.last').hasClass('on') && $('.explain1').val() == 1){
            $(".bguan").addClass('hide');
            $(".bguan").show()
        }else{
            $(".bguan").removeClass('hide')
        }
        if($('.explain1').val() == 1){
            if($('.first').hasClass('on')){
                $('.timePart').show()
                $('.arriveTime').show()
                $('.timePartb').hide()
                $('.arriveTimeb').hide()
                $('.aguan').show();
                $('.aguan guan').show();
                $('.bguan').hide();
                $('.bguan guan').hide();
            }
            if($('.second').hasClass('on')){
                $('.timePart').hide()
                $('.arriveTime').hide()
                $('.timePartb').show()
                $('.arriveTimeb').show()
                $('.aguan').hide();
                $('.aguan guan').hide();
                $('.bguan').show();
                $('.bguan guan').show();
            }
            if($('.last').hasClass('on')){
                $('.timePart').show()
                $('.arriveTime').show()
                $('.timePartb').show()
                $('.arriveTimeb').show()
                $('.aguan').show();
                $('.aguan guan').show();
                $('.bguan').show();
                $('.bguan guan').show();
            }
        }
        if($('.explain1').val() == 0){
            $('.timePart').hide()
            $('.arriveTime').hide()
            $('.timePartb').hide()
            $('.arriveTimeb').hide()
        }
    })


    var flag = false;
    function checkParse(event) {
        if($('.explain1').val() == 1){
            if($('.first').hasClass('on')){
                if($('.morninga').hasClass('on')){
                    var hour = $('#visithour_a').val();
                    var minute = $('#visitminute_a').val();
                    $('input.arrivea').val(hour + ":" + minute);
                    $('input.arrivea_part').val('上午');
                }else{
                    var hour = $('#visithour_p').val();
                    var minute = $('#visitminute_p').val();
                    $('input.arrivea').val(hour + ":" + minute)
                    $('input.arrivea_part').val('下午');
                }
            }
            if($('.second').hasClass('on')){
                if($('.morningb').hasClass('on')){
                    var hour = $('#Bvisithour_a').val();
                    var minute = $('#Bvisitminute_a').val();
                    $('input.arriveb').val(hour + ":" + minute);
                    $('input.arriveb_part').val('上午')
                }else{
                    var hour = $('#Bvisithour_p').val();
                    var minute = $('#Bvisitminute_p').val();
                    $('input.arriveb').val(hour + ":" + minute)
                    $('input.arriveb_part').val('下午')
                }
            }
            if($('.last').hasClass('on')){
                if($('.morninga').hasClass('on')){
                    var hour = $('#visithour_a').val();
                    var minute = $('#visitminute_a').val();
                    $('input.arrivea').val(hour + ":" + minute);
                    $('input.arrivea_part').val('上午')
                }
                if($('.afternoona').hasClass('on')){
                    var hour = $('#visithour_p').val();
                    var minute = $('#visitminute_p').val();
                    $('input.arrivea').val(hour + ":" + minute)
                    $('input.arrivea_part').val('下午')
                }
                if($('.morningb').hasClass('on')){
                    var hour = $('#Bvisithour_a').val();
                    var minute = $('#Bvisitminute_a').val();
                    $('input.arriveb').val(hour + ":" + minute);
                    $('input.arriveb_part').val('上午');
                }
                if($('.afternoonb').hasClass('on')){
                    var hour = $('#Bvisithour_p').val();
                    var minute = $('#Bvisitminute_p').val();
                    $('input.arriveb').val(hour + ":" + minute)
                    $('input.arriveb_part').val('下午')
                }
            }
        }
        $('.order_info input.check').each(function(){
            // 参数验证
             var text = $(this).val();
             if($('.tuanti').hasClass('on')){
                 if(text==""){
                     if($('.explain1').val() == 1 && $(this).attr('title') == "时间"){
                         flag = true;
                     }else{
                         // alert('请填写' + $(this).attr('title') + '!');
                         layer.alert('请填写' + $(this).attr('title') + '!',{
                             icon: 2,
                             title:false,
                             time:5000
                         })
                         flag = false;
                         event.preventDefault();
                     }
                 }
                 else{
                     flag = true;
                 }
             }
            if($('.geren').hasClass('on')){
                 if($(this).attr('title') == '单位名称' || $(this).attr('title') == '参观人数'){
                     return true;
                 }else{
                     if(text==""){
                         if($('.explain1').val() == 1 && $(this).attr('title') == "时间"){
                             flag = true;
                         }else{
                             // alert('请填写' + $(this).attr('title') + '!');
                             layer.alert('请填写' + $(this).attr('title') + '!',{
                                 icon: 2,
                                 title:false,
                                 time:5000
                             })
                             flag = false;
                             event.preventDefault();
                         }
                     }
                     else{
                         flag = true;
                     }
                 }
            }

        });
        if(flag){
            $("#order_info").submit();
        }

    }
    var flag = true;
    function next(event){
        var tel = $('.order_info .mobile').val();
        $('.order_info input').each(function(){
            var text = $(this).val();
            if(text==""){
                // alert('请填写' + $(this).attr('title') + '!');
                layer.alert('请填写' + $(this).attr('title') + '!',{
                    icon: 2,
                    title:false,
                    time:5000
                })
                flag = false;
                event.preventDefault();
                return false;
            }else{
                var reg = /(^1[3|4|5|7|8][0-9]{9}$)/;
                //手机号格式正确
                if (!reg.test(tel)) {
                    // alert('请输入正确的手机号');
                    layer.alert('请输入正确的手机号',{
                        icon: 2,
                        title:false,
                        time:5000
                    })
                    flag = false;
                    event.preventDefault();
                    return false;
                }else{
                    flag = true;
                }
            }
        });
        if(flag){
            $('.order_info1').hide();
            $('.order_info2').show();
        }
    }


    function back(){
        $('.order_info2').hide();
        $('.order_info1').show();
    }

    /**
     * 馆项点击ajax循环添加
     * **/
    $('.select_venue a').click(function(){
        var checkValue = $(this).attr("data-v");
        if($(".select_venue .on").attr("data-v") == "C"){
            $(".timeday1").css("display","block");
        }
        $(".guan1").val(checkValue);
        var day = $(".cday").val();
        var day1 = $(".bday").val();
        $.ajax({
            type: 'POST',
            url: 'runimformation',
            data: {"day":day,"venue":checkValue,"day1":day1,'explain':$(".explain1").val()},
            dataType:'json',
            success: function (result) {
                $(".aguan").find("p").remove();
                $(".bguan").find("p").remove();
                // if (result.yuyue){

                    if(result.explain == 1){

                        if(result.yuyueb){
                            if(result.yuyueb == ""){
                                // return ;
                            }
                            if(result.yuyueb == "0"){
                                // alert(result.venue1+"上午的预约人数已满");
                                layer.alert(result.venue1+"上午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                // return ;
                            }
                            if(result.yuyueb == "1"){
                                // alert(result.venue1+"下午的预约人数已满");
                                layer.alert(result.venue1+"下午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                // return ;
                            }
                            if(result.yuyueb == "0,1"){
                                // alert(result.venue1+"当日预约人数已满");
                                layer.alert(result.venue1+"当日预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                // return ;
                            }
                        }
                            if(result.yuyue == ""){
                                return ;
                            }
                            if(result.yuyue == "0"){
                                // alert(result.venue+"上午的预约人数已满");
                                layer.alert(result.venue+"上午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }
                            if(result.yuyue == "1"){
                                // alert(result.venue+"下午的预约人数已满");
                                layer.alert(result.venue+"下午的预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }
                            if(result.yuyue == "0,1"){
                                // alert(result.venue+"当日预约人数已满");
                                layer.alert(result.venue+"当日预约人数已满",{
                                    icon: 2,
                                    title:false,
                                    time:5000
                                })
                                return ;
                            }

                    }else{
                        var arr=JSON.stringify(result.yuyue);
                        var cc=JSON.parse(arr);
                        $.each(result.visit,function(i,val){
                            if($.inArray( i, cc )==-1){
                                $(".aguan").append(
                                    '<p href="javascript:;" onclick="setValue()" >' +
                                    val+ "</p>")
                            }else{
                                $(".aguan").append(
                                    '<p href="javascript:;" class="booked" onclick="setValue()" >' +
                                    val+ "</p>")
                            }
                        });
                        if(result.yuyueb){
                            $(".bguan").css("display","block");
                            $(".bguan").append(
                                ' <input class="time1" name="time1" type="hidden">');
                            var arr1=JSON.stringify(result.yuyueb);
                            var cc1=JSON.parse(arr1);
                            $.each(result.visit,function(i,val){
                                if($.inArray( i, cc1 )==-1){
                                    $(".bguan").append(
                                        '<p href="javascript:;" onclick="setValue1()" >' +
                                        val+ "</p>")
                                }else{
                                    $(".bguan").append(
                                        '<p href="javascript:;" class="booked"  onclick="setValue1()" >' +
                                        val+ "</p>")
                                }
                            })
                        }
                    }
                // }
                // if( $(".explain1").val() == 0  && $(".type1").val() ==1 && $(".cgr").val() < 10  ){
                //     $(".aguan").find("p").each(function(){
                //         $(this).addClass("booked");
                //     })
                //     $(".bguan").find("p").each(function(){
                //         $(this).addClass("booked");
                //     })
                // }
            },
            error: function(result){
                // alert("错误");
                layer.alert('错误',{
                    icon: 2,
                    title:false,
                    time:5000
                })
            },
        });
    });






    $(".province").change(function(){
        $(".city1").css("display","block");
        $(".city1").find("option").remove();
        $.ajax({
            type: 'get',
            url: '/province',
            data: {"id":$(".province").val()},
            dataType:'json',
            success: function (result) {
                $.each(result,function(i,val){
                    $(".city").append(
                        '<option  value="'+i+'">' +
                        val+ "</option>")
                });
            },
            error: function(result){
                // alert("21321");
            },
        });
    })


    $(".city").change(function(){
        $(".country1").css("display","block");
        $(".country1").find("option").remove();
        $.ajax({
            type: 'get',
            url: '/city',
            data: {"id":$(".city").val()},
            dataType:'json',
            success: function (result) {
                $.each(result,function(i,val){
                    $(".country").append(
                        '<option  value="'+i+'">' +
                        val+ "</option>")
                });
            },
            error: function(result){
                // alert("21321");
            },
        });
    })
    $('.timePart>a').click(function(){

    })

</script>
</body>
</html>